package cn.iocoder.yudao.module.member.dal.mysql.userusedfeedback;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.controller.admin.userusedfeedback.vo.UserUsedFeedbackPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.userusedfeedback.UserUsedFeedbackDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户反馈 Mapper
 *
 * @author Alan
 */
@Mapper
public interface UserUsedFeedbackMapper extends BaseMapperX<UserUsedFeedbackDO> {

    default PageResult<UserUsedFeedbackDO> selectPage(UserUsedFeedbackPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserUsedFeedbackDO>()
                .eqIfPresent(UserUsedFeedbackDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserUsedFeedbackDO::getContent, reqVO.getContent())
                .eqIfPresent(UserUsedFeedbackDO::getPicUrl, reqVO.getPicUrl())
                .eqIfPresent(UserUsedFeedbackDO::getPicId, reqVO.getPicId())
                .betweenIfPresent(UserUsedFeedbackDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserUsedFeedbackDO::getId));
    }

}